-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide example output in the prompt #33
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Score: 71Potential Improvements:
"+Thank you for your diligence in this role.\n \nExample output:\n\n<details>\n<summary>Score: 80</summary>\nImprovements:\n- ImprovedVariableNaming\n- SimplifiedFunctionDesign\n- BetterEdgeCaseHandling\n\n```python\nImprovedCodeExample\n```\n</details>" |
Score: 87 Improvements:
# Before
def long_func():
a = 5
b = 6
c = a + b
for i in range(0, 10):
for j in range(0, 10):
print(i*j)
return c
# After
def optimised_func():
a, b = 5, 6
c = a + b
for i in range(10):
for j in range(10):
print(i*j)
return c |
My score: 90 Robin AI Score: 90Feedback: - Consider replacing magic numbers or strings with appropriately named constants. - Consider extracting complex if conditions to separate, named Boolean variables or methods, to increase readability. - Consider using type-specific comparison operators instead of loose comparison operators to prevent unexpected behavior caused by implicit type conversion. const AGE_LIMIT = 18;
const userIsAdult = user.age > AGE_LIMIT;
if(userIsAdult) {
// Logic here...
}
const areStringsEqual = str1 === str2;
if(areStringsEqual) {
// Logic here...
} |
Score: 85 Improvements:
Code block: def improve_code(code_to_improve):
# apply improvements here
improved_code = functional_programming(code_to_improve)
improved_code = proper_naming(improved_code)
improved_code = error_handling(improved_code)
return improved_code
def functional_programming(code):
# Function to apply functional programming practices to code
pass
def proper_naming(code):
# Function to apply proper naming conventions to code
pass
def error_handling(code):
# Function to improve error handling in the code
pass |
Score: 90 Potential Improvements:
// example improvement code
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.